<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 刘
  Date: 2021/12/11
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset class="table-search-fieldset">
            <legend>搜索信息</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form class="layui-form layui-form-pane"
                      action="${pageContext.request.contextPath}/work/people/search.html">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">用户id</label>
                            <div class="layui-input-inline">
                                <input type="text" name="id" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">用户职务</label>
                            <div class="layui-input-inline">
                                <input type="text" name="position" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-primary" lay-submit
                                    lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn"
                    onclick="location.href='${pageContext.request.contextPath}/pages/fitness_manager_add.jsp'"> 添加
            </button>
            <button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"> 删除</button>
        </div>
        <table class="layui-table">
            <colgroup>
                <col width="150">
                <col width="200">
                <col>
                <col width="150">
                <col width="150">
            </colgroup>
            <thead>
            <tr>
                <th>学生id</th>
                <th>生理功能水平</th>
                <th>身体素质和运动能力水平</th>
                <th>身体形态发育水平</th>
                <th>适应能力</th>
                <th>心理发展状态</th>
                <th>创建时间</th>
                <th>更新时间</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${pageInfo.list}" var="fitness">
                <tr>
                    <td>${fitness.student_id}</td>
                    <td>${fitness.physiological}</td>
                    <td>${fitness.physical}</td>
                    <td>${fitness.developmental}</td>
                    <td>${fitness.adapt}</td>
                    <td>${fitness.status}</td>
                    <td>${fitness.create_time}</td>
                    <td>${fitness.update_time}</td>
                    <td>
                        <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit"
                           href="${pageContext.request.contextPath}/fitness/managerment/edit.html?id=${fitness.student_id}">编辑</a>
                    </td>
                    <td>
                        <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete"
                           href="${pageContext.request.contextPath}/fitness/managerment/delete.html?id=${fitness.student_id}">删除</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>

        <div class="layui-box layui-laypage layui-laypage-default">
            <ul class="pagination" style="display: flex">
                <li>
                    <a href="${pageContext.request.contextPath}/fitness/managerment/all.json?page=1&size=${pageInfo.pageSize}"
                       aria-label="Previous">首页</a>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/fitness/managerment/all.json?page=${pageInfo.pageNum-1}&size=${pageInfo.pageSize}">上一页</a>
                </li>
                <c:forEach begin="1" end="${pageInfo.pages}" var="pageNum">
                    <li>
                        <a href="${pageContext.request.contextPath}/fitness/managerment/all.json?page=${pageNum}&size=${pageInfo.pageSize}">${pageNum}</a>
                    </li>
                </c:forEach>
                <li>
                    <a href="${pageContext.request.contextPath}/fitness/managerment/all.json?page=${pageInfo.pageNum+1}&size=${pageInfo.pageSize}">下一页</a>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/fitness/managerment/all.json?page=${pageInfo.pages}&size=${pageInfo.pageSize}"
                       aria-label="Next">尾页</a>
                </li>
            </ul>
        </div>

    </div>
</div>
<script src="${pageContext.request.contextPath}lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use('laypage', function () {
        var laypage = layui.laypage;

        //执行一个laypage实例
        laypage.render({
            elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
            , count: 50 //数据总数，从服务端得到
        });
    });
</script>

<script>

</script>

</body>
</html>
